package com.etonedu.meals.bean;

import android.os.Parcel;
import android.os.Parcelable;

import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;

@Entity
public class TimeList implements Parcelable {
    /**
     * endDate : 2019-01-18 18:59:00
     * endTime : 1547809140000
     * ruleType : 3
     * startDate : 2019-01-18 14:00:00
     * startTime : 1547791200000
     */
    @Id
    private Long id;
    private String endDate;
    private long endTime;
    private int ruleType;
    private String startDate;
    private long startTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public long getEndTime() {
        return endTime;
    }

    public void setEndTime(long endTime) {
        this.endTime = endTime;
    }

    public int getRuleType() {
        return ruleType;
    }

    public void setRuleType(int ruleType) {
        this.ruleType = ruleType;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeString(this.endDate);
        dest.writeLong(this.endTime);
        dest.writeInt(this.ruleType);
        dest.writeString(this.startDate);
        dest.writeLong(this.startTime);
    }

    public TimeList() {
    }

    protected TimeList(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.endDate = in.readString();
        this.endTime = in.readLong();
        this.ruleType = in.readInt();
        this.startDate = in.readString();
        this.startTime = in.readLong();
    }

    public static final Creator<TimeList> CREATOR = new Creator<TimeList>() {
        @Override
        public TimeList createFromParcel(Parcel source) {
            return new TimeList(source);
        }

        @Override
        public TimeList[] newArray(int size) {
            return new TimeList[size];
        }
    };
}
